package cn.edu.sgu.www.mhxysy.controller.xingshi;

import cn.edu.sgu.www.mhxysy.consts.CustomConstants;
import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.MimeTypes;
import cn.edu.sgu.www.mhxysy.restful.JsonResult;
import cn.edu.sgu.www.mhxysy.service.xingshi.ChongwuEquipmentXingshiService;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Api(tags = "宠物装备星石管理")
@ApiSupport(author = CustomConstants.AUTHOR)
@Validated
@RestController
@RequestMapping(path = "/chongwu_equipment_xingshi", produces = MimeTypes.APPLICATION_JSON_CHARSET_UTF_8)
public class ChongwuEquipmentXingshiController {

    private final ChongwuEquipmentXingshiService chongwuEquipmentXingshiService;

    @Autowired
    public ChongwuEquipmentXingshiController(ChongwuEquipmentXingshiService chongwuEquipmentXingshiService) {
        this.chongwuEquipmentXingshiService = chongwuEquipmentXingshiService;
    }

    @ApiOperation("根据星石类型ID查询宠物装备名称")
    @RequestMapping(value = "/selectInlay", method = RequestMethod.GET)
    public JsonResult<List<String>> selectInlay(
            @ApiParam(name = "xingshiId", value = "星石类型ID", required = true)
            @NotNull(message = "星石类型" + CustomMessages.ID_NOT_NULL) Integer xingshiId) {
        List<String> list = chongwuEquipmentXingshiService.selectInlay(xingshiId);

        return JsonResult.success(null, list);
    }

}